<?php
/**
 * @author song
 * Enter description here ...
 * @author Administrator
 *
 */
class EmailController extends Controller {
	
    public function __construct($data) {
        parent::__construct($data);

    }
    
    
	/**
     * ユーザーの電子メールの歴史
     * @date 2013-4-11
     * @author song
     * $page    ページ番号
     * $id		メンバーID
     * Enter description here ...
     */
    public function emailRecord(){
    	require_once( '../system/ecjp_m.php' );
    	$this->_load_mdao_class("t_d_email");
    	$this->_set_head_footer();
        $g =  $this->g;
    	$dao = new t_d_email();
    	$wherearr = array();
    	if (!$g['id']){
    		$this->display('email_emailRecord.html');
    		exit();
    	}
        $id = $g['id'];echo $id;
        $wherearr[] = sprintf("( user_id = '%s')",$id);
        $this->assign('id',$id);
    	$page['current'] = (isset($g['page']) && $g['page'])?$g['page']:1;
        $page['item'] = PAGE_MAX;
        $data = $dao->emailRecord($wherearr,$page);
    	$this->assign('data',$data);
    	$this->assign('page', $page);
    	$this->assign('pageing', $this->fetch('page.html'));
    	$this->display('email_emailRecord.html');
    }
}